<template>
	<view class="box">
		<view class="nutrition-card">
			<u-row gutter="16">
				<u-col span="6">
					<view class="nutrition-item">
						<view class="title">
							<u-icon name="photo"></u-icon>
							<view class="name">卡路里</view>
						</view>
						<view class="value">{{ info.calorie }}</view>
					</view>
				</u-col>
				<u-col span="6">
					<view class="nutrition-item">
						<view class="title">
							<u-icon name="photo"></u-icon>
							<view class="name">蛋白质</view>
						</view>
						<view class="value">{{ info.protein }}</view>
					</view>
				</u-col>
			</u-row>
			<u-row gutter="16">
				<u-col span="6">
					<view class="nutrition-item">
						<view class="title">
							<u-icon name="photo"></u-icon>
							<view class="name">碳水化合物</view>
						</view>
						<view class="value">{{ info.carbohydrate }}</view>
					</view>
				</u-col>
				<u-col span="6">
					<view class="nutrition-item">
						<view class="title">
							<u-icon name="photo"></u-icon>
							<view class="name">脂肪</view>
						</view>
						<view class="value">{{ info.fat }}</view>
					</view>
				</u-col>
			</u-row>
			<view class="vip-button">
				<u-icon size="20" name="lock-open"></u-icon>
				<view class="text">开通会员查看营养成分</view>
			</view>
		</view>
		<view class="remake">*{{ info.remake }}</view>
	</view>
</template>

<script>
	export default {
		name: 'nutrition',
		props: {
			info: {
				type: Object,
				default: () => ({
					calorie: '',
					protein: '',
					carbohydrate: '',
					fat: '',
					remake: ''
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		margin-bottom: 40rpx;
	}
	.nutrition-card {
		padding: 40rpx 30rpx;
		background-color: #efefef;
		border-radius: 30rpx;
		.nutrition-item {
			display: flex;
			align-items: center;
			justify-content: space-between;
			height: 70rpx;
			font-size: 26rpx;
			.title {
				display: flex;
				align-items: center;
				.name {
					margin-left: 10rpx;
				}
			}
		}
		.vip-button {
			background-color: #fff;
			margin-top: 20rpx;
			height: 80rpx;
			border-radius: 40rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			.text {
				margin-left: 20rpx;
			}
		}
	}
	.remake {
		font-size: 26rpx;
		line-height: 70rpx;
	}
</style>